import 'package:flutter/services.dart';

import 'package:archime/event/event_robot_respone.dart';


class MimcRcvUtil{

  static const String CHANNEL_RECEIVE = "com.ithaca.archime/mimc";

  static const BasicMessageChannel<dynamic> rcvSender = const BasicMessageChannel(CHANNEL_RECEIVE,StandardMessageCodec());

  init(){
    rcvSender.setMessageHandler((param){
      operateNativeMessage(param);
      return;
    });
  }

  operateNativeMessage(param){
    print(param);
    if(param is String){
      eventBus.fire(EventRobotRespone(param));
    }
  }
}